package Demo;

import java.util.Random;
import java.util.Scanner;

public class dowhileDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        Random rand =new Random();
        int num = rand.nextInt(100);
        System.out.println("请输入数字");
       do {
            int input = scan.nextInt();
            if (num==input){
                System.out.println("猜对了");
                break;
            }else if (num<input){
                System.out.println("猜大了");
            }else {
                System.out.println("猜小了");
            }
        }while (true);



    }
}
